package com.jzo2o.market.mapper;

import com.jzo2o.market.model.domain.Coupon;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author itcast
 * @since 2023-09-16
 */
public interface CouponMapper extends BaseMapper<Coupon> {

    @Select("select count(*) from coupon_write_off where activity_id = #{activityId}")
    int writeOffNum(Long activityId);

    @Update("update coupon set status = 3 where activity_id = #{id}")
    void updateStatus(Long id);
}
